package com.hsc.yalebao.tools;

import android.text.InputFilter;
import android.text.Spanned;
import android.text.TextUtils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class CashierInputFilter
  implements InputFilter
{
  private static final int MAX_VALUE = 2147483647;
  private static final String POINTER = ".";
  private static final int POINTER_LENGTH = 2;
  private static final String ZERO = "0";
  Pattern mPattern = Pattern.compile("([0-9]|\\.)*");

  public CharSequence filter(CharSequence paramCharSequence, int paramInt1, int paramInt2, Spanned paramSpanned, int paramInt3, int paramInt4)
  {
    String str1 = paramCharSequence.toString();
    String str2 = paramSpanned.toString();
    if (TextUtils.isEmpty(str1))
      return "";
    Matcher localMatcher = this.mPattern.matcher(paramCharSequence);
    if (str2.contains("."))
    {
      if (!localMatcher.matches())
        return "";
      if (".".equals(paramCharSequence))
        return "";
      if (paramInt4 - str2.indexOf(".") > 2)
        return paramSpanned.subSequence(paramInt3, paramInt4);
    }
    else
    {
      if (!localMatcher.matches())
        return "";
      if (((".".equals(paramCharSequence)) || ("0".equals(paramCharSequence))) && (TextUtils.isEmpty(str2)))
        return "";
    }
    if (Double.parseDouble(str2 + str1) > 2147483647.0D)
      return paramSpanned.subSequence(paramInt3, paramInt4);
    return paramSpanned.subSequence(paramInt3, paramInt4) + str1;
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.tools.CashierInputFilter
 * JD-Core Version:    0.6.2
 */